package com.dragon.sdgp.util.defaultGenerate.strategy;

import com.dragon.sdgp.util.CommonUtil;
import com.dragon.sdgp.util.defaultGenerate.DefaultDataSources;

/**
 * @AUTHOR : Dragon_Yang
 * @File : PhoneNumberStrategy
 * @DESCRIPTION :
 * @DATE : 2023/3/17 17:46
 */
public class PhoneNumberGenerateStrategy implements GenerateStrategy{
    @Override
    public String createOne() {
        return createPhoneNumber();
    }

    /**
     * 创建一个手机号码
     * @return
     */
    private String createPhoneNumber(){
        StringBuilder phoneNumber = new StringBuilder(CommonUtil.getOneRandomInArray(DefaultDataSources.PHONE_PREFIX));
        for (int i = 0; i < 8; i++) {
            phoneNumber.append(CommonUtil.getRandom(10));
        }
        return phoneNumber.toString();
    }
}
